#include <POB-EYE.h>


/**************************functions to read and write on a 24c64 or more******************/
#define EEPROM_ADDR	0xA0

UInt8 Read24c64(UInt16 Addr)
{
	UInt8 tmp;

	SendSlaveAdress(EEPROM_ADDR);					//Send the Eeprom Adress	
	WriteOnI2C((UInt8)((Addr&0xff00)>>8));	//Send Addr H
	WriteOnI2C((UInt8)Addr&0x00ff);			//Send Addr L	
	
	SendSlaveAdress(EEPROM_ADDR|1);		
	tmp=ReadOnI2C();

	STOPI2C
	return tmp;
}




Int8 Write24c64(UInt16 Addr,UInt8 Data)
{	
	SendSlaveAdress(EEPROM_ADDR);			//Send the Eeprom Adress	
	WriteOnI2C((UInt8)((Addr&0xff00)>>8));	//Send Addr H
	WriteOnI2C((UInt8)Addr&0x00ff);			//Send Addr L
	WriteOnI2C(Data);						//Send Data 
	
	STOPI2C	
}
/*************************************************************************************************/
